package com.codeanalysissys.backend.graphs.pdg;

import com.codeanalysissys.backend.cpp.CppDDGBuilder;
import com.codeanalysissys.backend.golang.GoCDGBuilder;
import com.codeanalysissys.backend.golang.GoDDGBuilder;
import com.codeanalysissys.backend.java.JavaCDGBuilder;
import com.codeanalysissys.backend.java.JavaDDGBuilder;
import com.codeanalysissys.backend.javascript.JavaScriptCDGBuilder;
import com.codeanalysissys.backend.javascript.JavaScriptDDGBuilder;
import com.codeanalysissys.backend.python.PythonCDGBuilder;
import com.codeanalysissys.backend.python.PythonDDGBuilder;
import com.codeanalysissys.backend.ruby.RubyCDGBuilder;
import com.codeanalysissys.backend.ruby.RubyDDGBuilder;

import java.io.IOException;
import java.io.InputStream;

public class DDGBuilder {
    public static DataDependenceGraph build(String lang, InputStream content) throws IOException {
        switch (lang) {
            case "Cpp":
//                return CppCDGBuilder.build(content);
                return CppDDGBuilder.build(content);
            //
            case "C":
                return null;
            //
            case "Java":
                return JavaDDGBuilder.build(content);
            case "JavaScript":
                return JavaScriptDDGBuilder.build(content);
            //
            case "Python":
                return PythonDDGBuilder.build(content);
            //
            case "Golang":
                return GoDDGBuilder.build(content);
            case "Ruby":
                return RubyDDGBuilder.build(content);
            //
            default:
                return null;
        }
    }
}
